﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.ComponentModel.DataAnnotations;

namespace HQPad.Models
{
    public class RuleSet
    {
        public int RuleSetID { get; set; }

        [Display(Name = "Major version")]
        [Required(ErrorMessage = "A major version is required")]
        [Range(1, 100, ErrorMessage = "Major version is limited to between 1 and 100")]
        public int MajorVersion { get; set; }
        
        [Display(Name = "Minor version")]
        [Required(ErrorMessage = "A minor version is required")]
        [Range(0, 1000, ErrorMessage = "Minor version is limited to between 1 and 1000")]
        public int MinorVersion { get; set; }

        [Display(Name = "Rules enabled")]
        [Required(ErrorMessage = "The enabled flag is required")]
        public bool Enabled { get; set; }

        public virtual IEnumerable<Skill> Skills { get; set;}

        [Display(Name = "Date last updated")]
        [DisplayFormat(DataFormatString = "{0:d}", ApplyFormatInEditMode = true)]
        public DateTime? LastUpdated { get; set; }

        [Display(Name = "Last updated by")]
        public int? LastUpdatedByUserID { get; set; }
    }
}